package com.springboot.project.controller;

import com.springboot.project.common.HHResult;
import com.springboot.project.service.IUserService;
import org.apache.logging.log4j.core.tools.picocli.CommandLine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;

/**
 * @author liupenghui
 * @date 2018/7/11
 * @desc：
 */
@RestController
@RequestMapping("/api")
public class IndexController {

    @Autowired
    private IUserService userService;

    @RequestMapping(value = "user/{id}")
    public HHResult getUser(@PathVariable Integer id){
        return new HHResult(0,userService.getUser(id),"成功");
    }


//    @PostMapping(value = "user")
//    public HHResult getUser(@RequestBody String id){
////        return new HHResult(0,userService.getUser(id),"成功");\
//        System.out.println(id);
//        return new HHResult(0,null,"成功");
//    }

}
